package com.etc.order.provider.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.etc.order.common.domain.ShoppingCart;
import com.etc.order.common.service.ShoppingCartService;
import com.etc.order.provider.mapper.ShoppingCartMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class ShoppingCartServiceImpl implements ShoppingCartService {
    @Autowired
    private ShoppingCartMapper shoppingCartMapper;

    @Override
    public List<ShoppingCart> findByUid(int uid) {
        return shoppingCartMapper.findByUid(uid);
    }

    @Override
    public int deleteByUid(int uid) {
        return shoppingCartMapper.deleteByUid(uid);
    }

    @Override
    public int deleteByUidAndProductId(int uid, String productId) {
        return shoppingCartMapper.deleteByUidAndProductId(uid, productId);
    }

    @Override
    public int insertShoppingCart(ShoppingCart cart) {
        return shoppingCartMapper.insertShoppingCart(cart);
    }

    @Override
    public int updateShoppingCart(ShoppingCart cart) {
        return shoppingCartMapper.updateShoppingCart(cart);
    }
}
